package com.test.concurrency;

public class SynchronizedEventGenerator extends IntGenerator {

	private int currentEventValue = 0;

	@Override
	public synchronized int next() {
		++currentEventValue;
		Thread.yield();// cause failure faster
		++currentEventValue;
		return currentEventValue;
	}
public static void main(String[] args){
	EvenChecker.test(new SynchronizedEventGenerator());
}
}
